home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-07-08 | 3.6 KB | 144 lines | [TEXT/MPS ] |
-
- // ---- End Project Data ----
-
-
- // ---- File Wrap It Up.t ----
-
- // Before Script for "paragraphApp"
- // Copyright © 1994 by Apple Computer, Inc. All rights reserved.
-
- paragraphApp :=
- {title: "Wrap It Up",
- viewBounds: {top: 0, left: 0, right: 240, bottom: 336},
- viewSetupFormScript:
- func()
- begin
- constant kMaxWidth := 240;
- constant kMaxHeight := 336;
-
- local b := GetAppParams();
-
- self.viewBounds := RelBounds(b.appAreaLeft, b.appAreaTop,
- Min(b.appAreaWidth, kMaxWidth),
- Min(b.appAreaHeight, kMaxHeight)
- );
- end,
- _proto: protoApp,
- debug: "paragraphApp"
- };
-
- _view000 := /* child of paragraphApp */
- {viewFlags: 33,
- viewFormat: 337,
- viewBounds: {left: 9, top: 25, right: 231, bottom: 159},
- viewSetupChildrenScript:
- func()
- begin
- stepchildren := EnsureInternal(stepchildren);
- end,
- viewclass: 77
- };
-
- theParagraph := /* child of _view000 */
- {viewFlags: 134217737,
- viewFormat: 337,
- viewFont: userFont12,
- viewBounds: {left: 9, top: 9, right: 209, bottom: 105}
- ,
- text: "Word",
- viewJustify: 0,
- viewclass: 81,
- debug: "theParagraph"
- };
- // View theParagraph is declared to paragraphApp
-
- // After Script for "theParagraph"
- thisView := theParagraph;
- thisView.viewLineSpacing := nil;
- // Make sure this slot is set here so it doesn't inherit
- // GetRoot() has a viewLineSpacing slot!
-
-
-
-
-
- addAbove := /* child of paragraphApp */
- {text: "Add word above",
- buttonClickScript:
- func()
- begin
- SetValue(theParagraph, 'text, theParagraph.text && GetRandomWord(0, 20));
- SetValue(theParagraph, 'viewBounds, theParagraph.viewBounds);
-
- // the second SetValue is needed to tweak the clParagraphView into
- // updating an internal cache. It's a workarond for a clParagraphView
- // bug. The SetValue doesn't necessarily have to be for viewBounds.
- end,
- viewBounds: {left: 10, top: 170, right: 110, bottom: 182},
- _proto: protoTextButton,
- debug: "addAbove"
- };
-
-
-
- addBelow := /* child of paragraphApp */
- {text: "Add word below",
- buttonClickScript:
- func()
- begin
- SetValue(anotherParagraph, 'text, anotherParagraph.text && GetRandomWord(0, 20));
- end,
- viewBounds: {left: 130, top: 170, right: 230, bottom: 182},
- _proto: protoTextButton,
- debug: "addBelow"
- };
-
-
-
- anotherParagraph := /* child of paragraphApp */
- {viewFlags: 6657,
- viewFormat: 337,
- viewFont: userFont12,
- viewBounds: {left: 17, top: 193, right: 223, bottom: 209},
- text: "Word",
- viewJustify: 0,
- viewChangedScript:
- func(slot, view)
- begin
- if slot = 'text and view = self then
- :AdjustHeight();
- end,
- AdjustHeight:
- func()
- begin
- local width := viewBounds.right - viewBounds.left;
- local height := call kSimpleTextHeightFunc with (text, width, viewFont);
-
- if viewBounds.top + height <> viewBounds.bottom then
- begin
- local newBounds := DeepClone(viewBounds);
- newBounds.bottom := newBounds.top + height;
- SetValue(self, 'viewBounds, newBounds);
- end;
- end;,
- viewclass: 81,
- debug: "anotherParagraph"
- };
- // View anotherParagraph is declared to paragraphApp
-
- // After Script for "anotherParagraph"
- thisView := anotherParagraph;
- thisView.viewLineSpacing := nil;
-
- // Make sure this slot is set here so it doesn't inherit
- // GetRoot() has a viewLineSpacing slot!
-
-
-
-
-
-
-
- // ---- Beginning of section for non used Layout files ----
-
- // End of output